-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress and Error notifications: keep state of multiple concurrent Stories being saved #297
Progress and Error notifications: keep state of multiple concurrent Stories being saved #297
Conversation
…he StoryRepository
…we're saving concurrently, to show the right progress notifications
…n the foregorund and we tap on a new error notification
You can test the changes on this Pull Request by downloading the APK here. |
Hi @mzorz 😄 so I tried the Happy path but I kept getting a crash when I tried to create the second story. So what I think is happening is
|
app/src/main/java/com/automattic/portkey/compose/ComposeLoopFrameActivity.kt
Show resolved
Hide resolved
app/src/main/java/com/automattic/portkey/compose/frame/FrameSaveManager.kt
Show resolved
Hide resolved
Thank you for your review, tests, and comments all around @jd-alexander !
I haven't been able to reproduce this issue here (
Thanks for this one 🙏. As discussed, tracked this one here #299 and going to tackle it separately (it's happening on
Or alternatively, use a Pixel 2 emulator where we know this issue won't be run into. I think we should be able to continue unless on your side you see anything else blocking the tests for this PR? wdyt? |
app/src/main/java/com/automattic/portkey/compose/ComposeLoopFrameActivity.kt
Outdated
Show resolved
Hide resolved
@@ -318,8 +377,11 @@ class FrameSaveNotifier(private val context: Context, private val service: Frame | |||
doNotify(notificationId, notificationBuilder.build()) // , notificationType) | |||
} | |||
|
|||
fun getNotificationIdForError(): Long { | |||
return BASE_MEDIA_ERROR_NOTIFICATION_ID.toLong() | |||
fun getNotificationIdForError(storyIdx: StoryIndex): Int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be renamed to storyIndex
when I was scrolling and I saw it I thought it meant id and then I realized it's in an index. Of course, it's not necessary. Just a thought :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure 👍 fixed in 03f31b5
I just got another crash. Not sure if it's related. I was trying to follow the happy path. I added the first set of stories but upon adding the second set the crash occurred. Let me know if this is related to this PR #292
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- So I was able to get the happy path working on my Pixel 4 XL device.
- For the error path, I applied the patch and got the error notifications as expected.
I was also able to click on the stories and I was taken to the compose screen with the videos I selected for processing. LGTM 🚢 🕺
I left some minor comments 👍
@mzorz something I noticed when testing on my Pixel 4 XL. I wasn't able to add the emojis. Let me know if this is something you can reproduce or if you have been tracking this. Thanks, I think it might be device-related. It works fine on the emulator. |
app/src/main/java/com/automattic/portkey/compose/frame/FrameSaveNotifier.kt
Outdated
Show resolved
Hide resolved
Co-Authored-By: Joel Dean <[email protected]>
…ttps://github.com/Automattic/portkey-android into issue/273-save-frame-service-no-state-multi-errror
…ave-frame-service-no-state-multi-errror
Yes exactly that crash was fixed in #290, merged in #292 and also another layer of protection was added (as I ran into another case) in this WIP PR. That one should cover it 💪
Yeah saw this one too on the Pixel 3 emulator, on |
Thanks for your review once more Joel! Merging now 👍 |
Builds on top of #287
This PR fixes the problem identified in #286 (comment), by keeping state in the
FrameSaveNotifier
class of the amount of frames being saved belonging to different Stories.This gives us 2 precious things:
Saving <story title>...
toSaving several stories...
and viceversa depending on how things are goingScreenshots:
Video showcasing this here:
https://cloudup.com/cMS87Fa9j3i
To test
CASE A: Happy path:
ComposeLoopFrameActivity
with this:This will set the story title to be something like
Test0
orTest1
, etc.Saving Test0...
title on it.Saving several stories...
title on it.Saving Test1...
note it's no longer Test0, but Test1, indicating Test0 has finished now and we only have frames from Test1 remaining to be saved.CASE B: Error path